3.1.70 \(\int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))^2} \, dx\) [70]

Optimal. Leaf size=161 \[ \frac {2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} c^2 f}-\frac {\text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{2 \sqrt {2} \sqrt {a} c^2 f}+\frac {3 \cot (e+f x) \sqrt {a+a \sec (e+f x)}}{2 a c^2 f}-\frac {\cot ^3(e+f x) (a+a \sec (e+f x))^{3/2}}{3 a^2 c^2 f} \]

[Out]

-1/3*cot(f*x+e)^3*(a+a*sec(f*x+e))^(3/2)/a^2/c^2/f+2*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))/c^2/f/a
^(1/2)-1/4*arctan(1/2*a^(1/2)*tan(f*x+e)*2^(1/2)/(a+a*sec(f*x+e))^(1/2))/c^2/f*2^(1/2)/a^(1/2)+3/2*cot(f*x+e)*
(a+a*sec(f*x+e))^(1/2)/a/c^2/f

________________________________________________________________________________________

Rubi [A]
time = 0.16, antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3989, 3972, 491, 597, 536, 209} \begin {gather*} -\frac {\cot ^3(e+f x) (a \sec (e+f x)+a)^{3/2}}{3 a^2 c^2 f}+\frac {2 \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{\sqrt {a} c^2 f}-\frac {\text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{2 \sqrt {2} \sqrt {a} c^2 f}+\frac {3 \cot (e+f x) \sqrt {a \sec (e+f x)+a}}{2 a c^2 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[1/(Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x])^2),x]

[Out]

(2*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/(Sqrt[a]*c^2*f) - ArcTan[(Sqrt[a]*Tan[e + f*x])/(S
qrt[2]*Sqrt[a + a*Sec[e + f*x]])]/(2*Sqrt[2]*Sqrt[a]*c^2*f) + (3*Cot[e + f*x]*Sqrt[a + a*Sec[e + f*x]])/(2*a*c
^2*f) - (Cot[e + f*x]^3*(a + a*Sec[e + f*x])^(3/2))/(3*a^2*c^2*f)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 491

Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*c*e*(m + 1))), x] - Dist[1/(a*c*e^n*(m + 1)), Int[(e*x)^(m +
n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[(b*c + a*d)*(m + n + 1) + n*(b*c*p + a*d*q) + b*d*(m + n*(p + q + 2) + 1)*
x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p, q}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[m, -1] && IntBino
mialQ[a, b, c, d, e, m, n, p, q, x]

Rule 536

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 597

Int[((g_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.)*((e_) + (f_.)*(x_)^(n_)),
x_Symbol] :> Simp[e*(g*x)^(m + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n)^(q + 1)/(a*c*g*(m + 1))), x] + Dist[1/(a*c*
g^n*(m + 1)), Int[(g*x)^(m + n)*(a + b*x^n)^p*(c + d*x^n)^q*Simp[a*f*c*(m + 1) - e*(b*c + a*d)*(m + n + 1) - e
*n*(b*c*p + a*d*q) - b*e*d*(m + n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, q}, x] &&
 IGtQ[n, 0] && LtQ[m, -1]

Rule 3972

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[-2*(a^(m/2 +
 n + 1/2)/d), Subst[Int[x^m*((2 + a*x^2)^(m/2 + n - 1/2)/(1 + a*x^2)), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rule 3989

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[((-a)*c)^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rubi steps

\begin {align*} \int \frac {1}{\sqrt {a+a \sec (e+f x)} (c-c \sec (e+f x))^2} \, dx &=\frac {\int \cot ^4(e+f x) (a+a \sec (e+f x))^{3/2} \, dx}{a^2 c^2}\\ &=-\frac {2 \text {Subst}\left (\int \frac {1}{x^4 \left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{a^2 c^2 f}\\ &=-\frac {\cot ^3(e+f x) (a+a \sec (e+f x))^{3/2}}{3 a^2 c^2 f}-\frac {\text {Subst}\left (\int \frac {-9 a-3 a^2 x^2}{x^2 \left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{3 a^2 c^2 f}\\ &=\frac {3 \cot (e+f x) \sqrt {a+a \sec (e+f x)}}{2 a c^2 f}-\frac {\cot ^3(e+f x) (a+a \sec (e+f x))^{3/2}}{3 a^2 c^2 f}+\frac {\text {Subst}\left (\int \frac {-21 a^2-9 a^3 x^2}{\left (1+a x^2\right ) \left (2+a x^2\right )} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{6 a^2 c^2 f}\\ &=\frac {3 \cot (e+f x) \sqrt {a+a \sec (e+f x)}}{2 a c^2 f}-\frac {\cot ^3(e+f x) (a+a \sec (e+f x))^{3/2}}{3 a^2 c^2 f}+\frac {\text {Subst}\left (\int \frac {1}{2+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{2 c^2 f}-\frac {2 \text {Subst}\left (\int \frac {1}{1+a x^2} \, dx,x,-\frac {\tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c^2 f}\\ &=\frac {2 \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{\sqrt {a} c^2 f}-\frac {\tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{2 \sqrt {2} \sqrt {a} c^2 f}+\frac {3 \cot (e+f x) \sqrt {a+a \sec (e+f x)}}{2 a c^2 f}-\frac {\cot ^3(e+f x) (a+a \sec (e+f x))^{3/2}}{3 a^2 c^2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
time = 24.25, size = 5576, normalized size = 34.63 \begin {gather*} \text {Result too large to show} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[1/(Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x])^2),x]

[Out]

Result too large to show

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(376\) vs. \(2(136)=272\).
time = 0.25, size = 377, normalized size = 2.34

method result size
default \(\frac {\sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}\, \left (12 \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \left (\cos ^{2}\left (f x +e \right )\right ) \sin \left (f x +e \right ) \sqrt {2}+3 \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right ) \left (\cos ^{2}\left (f x +e \right )\right ) \sin \left (f x +e \right )-12 \sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right )-3 \sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right )-22 \left (\cos ^{3}\left (f x +e \right )\right )-4 \left (\cos ^{2}\left (f x +e \right )\right )+18 \cos \left (f x +e \right )\right )}{12 c^{2} f \sin \left (f x +e \right )^{3} a}\) \(377\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

1/12/c^2/f*(a*(cos(f*x+e)+1)/cos(f*x+e))^(1/2)*(12*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*arctanh(1/2*(-2*cos(f*
x+e)/(cos(f*x+e)+1))^(1/2)*sin(f*x+e)/cos(f*x+e)*2^(1/2))*cos(f*x+e)^2*sin(f*x+e)*2^(1/2)+3*(-2*cos(f*x+e)/(co
s(f*x+e)+1))^(1/2)*ln((sin(f*x+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))*cos(f*x+e)^2*
sin(f*x+e)-12*2^(1/2)*arctanh(1/2*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*sin(f*x+e)/cos(f*x+e)*2^(1/2))*(-2*cos(
f*x+e)/(cos(f*x+e)+1))^(1/2)*sin(f*x+e)-3*sin(f*x+e)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*ln((sin(f*x+e)*(-2*c
os(f*x+e)/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))-22*cos(f*x+e)^3-4*cos(f*x+e)^2+18*cos(f*x+e))/sin(f*
x+e)^3/a

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(1/(sqrt(a*sec(f*x + e) + a)*(c*sec(f*x + e) - c)^2), x)

________________________________________________________________________________________

Fricas [A]
time = 4.86, size = 566, normalized size = 3.52 \begin {gather*} \left [-\frac {3 \, \sqrt {2} \sqrt {-a} {\left (\cos \left (f x + e\right ) - 1\right )} \log \left (-\frac {2 \, \sqrt {2} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) - 3 \, a \cos \left (f x + e\right )^{2} - 2 \, a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) \sin \left (f x + e\right ) + 12 \, \sqrt {-a} {\left (\cos \left (f x + e\right ) - 1\right )} \log \left (-\frac {8 \, a \cos \left (f x + e\right )^{3} + 4 \, {\left (2 \, \cos \left (f x + e\right )^{2} - \cos \left (f x + e\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right ) - 7 \, a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right ) + 1}\right ) \sin \left (f x + e\right ) - 4 \, {\left (11 \, \cos \left (f x + e\right )^{2} - 9 \, \cos \left (f x + e\right )\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}}}{24 \, {\left (a c^{2} f \cos \left (f x + e\right ) - a c^{2} f\right )} \sin \left (f x + e\right )}, \frac {3 \, \sqrt {2} \sqrt {a} {\left (\cos \left (f x + e\right ) - 1\right )} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) \sin \left (f x + e\right ) + 12 \, \sqrt {a} {\left (\cos \left (f x + e\right ) - 1\right )} \arctan \left (\frac {2 \, \sqrt {a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right )}{2 \, a \cos \left (f x + e\right )^{2} + a \cos \left (f x + e\right ) - a}\right ) \sin \left (f x + e\right ) + 2 \, {\left (11 \, \cos \left (f x + e\right )^{2} - 9 \, \cos \left (f x + e\right )\right )} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}}}{12 \, {\left (a c^{2} f \cos \left (f x + e\right ) - a c^{2} f\right )} \sin \left (f x + e\right )}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[-1/24*(3*sqrt(2)*sqrt(-a)*(cos(f*x + e) - 1)*log(-(2*sqrt(2)*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))
*cos(f*x + e)*sin(f*x + e) - 3*a*cos(f*x + e)^2 - 2*a*cos(f*x + e) + a)/(cos(f*x + e)^2 + 2*cos(f*x + e) + 1))
*sin(f*x + e) + 12*sqrt(-a)*(cos(f*x + e) - 1)*log(-(8*a*cos(f*x + e)^3 + 4*(2*cos(f*x + e)^2 - cos(f*x + e))*
sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e) - 7*a*cos(f*x + e) + a)/(cos(f*x + e) + 1))*sin(
f*x + e) - 4*(11*cos(f*x + e)^2 - 9*cos(f*x + e))*sqrt((a*cos(f*x + e) + a)/cos(f*x + e)))/((a*c^2*f*cos(f*x +
 e) - a*c^2*f)*sin(f*x + e)), 1/12*(3*sqrt(2)*sqrt(a)*(cos(f*x + e) - 1)*arctan(sqrt(2)*sqrt((a*cos(f*x + e) +
 a)/cos(f*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e)))*sin(f*x + e) + 12*sqrt(a)*(cos(f*x + e) - 1)*arctan(2*s
qrt(a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e)/(2*a*cos(f*x + e)^2 + a*cos(f*x + e)
- a))*sin(f*x + e) + 2*(11*cos(f*x + e)^2 - 9*cos(f*x + e))*sqrt((a*cos(f*x + e) + a)/cos(f*x + e)))/((a*c^2*f
*cos(f*x + e) - a*c^2*f)*sin(f*x + e))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {1}{\sqrt {a \sec {\left (e + f x \right )} + a} \sec ^{2}{\left (e + f x \right )} - 2 \sqrt {a \sec {\left (e + f x \right )} + a} \sec {\left (e + f x \right )} + \sqrt {a \sec {\left (e + f x \right )} + a}}\, dx}{c^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c-c*sec(f*x+e))**2/(a+a*sec(f*x+e))**(1/2),x)

[Out]

Integral(1/(sqrt(a*sec(e + f*x) + a)*sec(e + f*x)**2 - 2*sqrt(a*sec(e + f*x) + a)*sec(e + f*x) + sqrt(a*sec(e
+ f*x) + a)), x)/c**2

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(c-c*sec(f*x+e))^2/(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Ch
eck [abs(co

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}\,{\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )}^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/((a + a/cos(e + f*x))^(1/2)*(c - c/cos(e + f*x))^2),x)

[Out]

int(1/((a + a/cos(e + f*x))^(1/2)*(c - c/cos(e + f*x))^2), x)

________________________________________________________________________________________